package wili.misc;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 
 * @author weilai
 */
public class Exhausters {
	/**
	 * @param repeatable
	 * @param optsList
	 * @return
	 */
	public static List<List<Object>> listOf(boolean repeatable, Object[]... optsList) {
		RowExhausterOnOptsList it = new RowExhausterOnOptsList(repeatable, optsList);
		List<List<Object>> ret = new ArrayList<>();
		while (it.hasNext()) {
			Object[] oo = it.next();
			List<Object> lis = new ArrayList<>(Arrays.asList(oo));
			ret.add(lis);
		}
		return ret;
	}

}
